<?php

namespace app\index\controller;
use app\index\model\MgsRead as MRM;
class Msgread extends Base
{
    public function get(){
        $user = new MRM();
        $data=$this->request->param();
        return $user->selectModel($data);
    }
    public function update()
    {
        $data = $this->request->param();
        $res = new MRM();
        return $res->updateModel($data);
    }
    public function delete(){
        $data = $this->request->param();
        $res = new MRM();
        return $res->deleteModel($data);
    }
    public function save(){
        $res = new MRM();
        $data = $this->request->param();
        $map =['msg_id'=>$data['msg_id'],'u_id'=>$data['u_id']];
        $re =$res->get($map);
        if( $re==null){
            $res->saveModel($map);
            return 1;
        }else{
            return 0;
        }
    }

}